﻿@{
    Layout = "~/Views/Shared/_FormWhite.cshtml";
}

<div>
    <form id="form">
        <div class="form-group">
            <label class="col-sm-2 control-label ">货物<font class="red"> *</font></label>
            <div class="col-sm-4">
                <div id="productids" col="productids">
                </div>
            </div>
        </div>
    </form>
</div>

<script type="text/javascript">
    var id = ys.request("id");
    var colorid = ys.request("colorid");
    $(function () {
        $("#productids").ysComboBox({
            url: '@Url.Content("~/QixingManage/StoreGoodsProduct/GetSelectCarListJson")?colorid='+colorid,
            key: "pw_id",
            value: "VINName",
            class: "form-control",
             multiple: true
        });

        $('#form').validate({
            rules: {
                categoryid: { required: true }
            }
        });
    });


    function saveForm(index) {
        if ($('#form').validate().form()) {
            var postData = $('#form').getWebControls({ Id: id });
            ys.ajax({
                url: '@Url.Content("~/QixingManage/StoreOrderDetail/OrderDetailSaveFormJson")',
                type: 'post',
                data: postData,
                success: function (obj) {
                    if (obj.Tag == 1) {
                        ys.msgSuccess(obj.Message);
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layui.table.reload('tableId');
                        parent.layer.close(index);
                    }
                    else {
                        ys.msgError(obj.Message);
                    }
                }
            });
        }
    }
</script>

